package com.jinfang.bankpractice.dto;

public class ReturnData {
	/*
	 * 201 Created
	 *  401 Unauthorized 
	 *  403 Forbidden 
	 *  404 Not Found
	 */
	public static final int SUCCESS=200;
	public static final int CREATED = 201;
	public static final int UNAUTHORIZED = 401;
	public static final int FORBIDDEN = 403;
	public static final int NOT_FOUND = 404;

	int status;
	String message;
	String error;
	Object data;

	public ReturnData() {
		super();
	}

	public ReturnData(int status, String message, String error, Object data) {
		super();
		this.status = status;
		this.message = message;
		this.error = error;
		this.data = data;
	}

	/**
	 * 成功的返回值
	 * @param message
	 * @param data
	 * @return
	 */
	public static ReturnData buildSuccess(String message,Object data){
		return new ReturnData(SUCCESS, message, "", data);
	}
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
